<include file="./head" />
<include file="./logo" />
    <div class="page-viewport">
        <div class="page-content">
        

<div class="notice">
    <p>提示：如果支付失败，是因为支付宝信息有误，不能完成支付。请核对后修改支付宝信息、或者使用手机充值，并重新提交提现申请。</p>
</div>
<table class="table table-striped">
    <thead>
        <tr>
            <th>日期</th>
            <th>类型</th>
            <th>金额</th>
            <th>状态</th>
        </tr>
    </thead>
      <tbody id="h24data">
         <td  class="loading">真正读取数据,请稍等...</td>
        </tbody>
</table>

 <div id="page"></div>

        </div>
    </div>
</div>
<div class="bottom_line"></div>
 
 <script type="text/javascript">
            var page_cur = 1; //当前页
            var total_num, page_size, page_total_num;//总记录数,每页条数,总页数
            function getData(page) { //获取当前页数据
                $.ajax({
                    type: 'GET',
                    url: '<?php echo U("/User/Withdraw/tixian_log"); ?>',
                    data: {'page': page - 1},
                    dataType: 'json',
                    success: function(json) {
                        $("#h24data").empty();
                        $(".loading").hide();
                        total_num = json.total_num;//总记录数
                        page_size = json.page_size;//每页数量
                        page_cur = page;//当前页
                        page_total_num = json.page_total_num;//总页数
                        var li = "<tr>";
                        var list = json.list;
                        $.each(list, function(index, array) { //遍历返回json
                            li += "<td style='overflow:hidden'>"+get_time(array['time'])+"</td><td>"+ get_type(array['type'])+"</td><td>"+ array['price']+"</td><td>"+get_status(array['status'])+"</td></tr>";
                        });
                        $("#h24data").append(li);
                    },
                    beforeSend:function(){
                         $(".loading").show();
                    },
                    complete: function() {
                       getPageBar();//js生成分页，可用程序代替
                    },
                    error: function() {
                        $("#h24data").html("系统超时,请稍等在操作!");
                    }
                });
            }


            $(function() {
                 getData(1);
                $("#page a").live('click', function() { //live 向未来的元素添加事件处理器,不可用bind
                    var page = $(this).attr("data-page");//获取当前页
                    getData(page)
                });  
            });

           function getPageBar() { //js生成分页
                if (page_cur > page_total_num)
                    page_cur = page_total_num;//当前页大于最大页数
                if (page_cur < 1)
                    page_cur = 1;//当前页小于1
                page_str = "";//"<span>共" + total_num + "条</span><span>" + page_cur + "/" + page_total_num + "</span>";
                if (page_cur <= 1) {
                    page_str += "<span class='home'>首页</span>";
                } else {
                    page_str += "<span><a href='javascript:void(0)' data-page='" + (page_cur - 1) + "'>上一页</a></span>";
                }
                if (page_cur >= page_total_num) { 
                    page_str += "<span class='home'>尾页</span>";
                } else {
                    page_str += "<span><a href='javascript:void(0)' data-page='" + (parseInt(page_cur) + 1) + "'>下一页</a></span>";
                }
                if(total_num>6){
                    $("#page").html(page_str);
                }
                
            }
        </script>
<include file="./foot" />